package lab02;

public class Golem implements  Boss{
    private  String name;
    private int boold;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getBoold() {
        return boold;
    }

    public void setBoold(int boold) {
        this.boold = boold;
    }

    public Golem(String name, int boold) {
        this.name = name;
        this.boold = boold;
    }

    @Override
    public void attack() {
        System.out.println(this.name+"正在用小斧子进行攻击"+",还剩"+this.boold+"血量");
        if(boold<10){
            System.out.println("进行血量补给");
            buildBoold();
        }

    }

    @Override
    public void move() {
        System.out.println(this.name+"急速行走");

    }

    @Override
    public void buildBoold() {
        if(boold<10){
            setBoold(boold+20);
            System.out.println("血量补给完成,还有"+getBoold()+"血");

        }



    }
}
